package reflex.learning02;

import java.util.List;
import java.util.Map;

/**
 * @program JavaBase
 * @description:
 * @author: zhanglu
 * @create: 2019-06-07 20:14:00
 */
@MyAnnotation(value = "zhanglu")
public class Person extends Creature<String> implements Comparable, MyInterface{

    private String name;
    private Integer age;

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    //创建类时，尽量保留一个空参构造器
    public Person() {
        super();
        System.out.println("Person无参构造器");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @MyAnnotation(value = "show")
    public void show(){
        System.out.println("我是一个人");
    }

    private void disPlay(String s) throws Exception{
        System.out.println("我的国籍是：" + s);
    }

    private void disPlay(List<String> s, Map<String, Object> m) throws Exception{
        for(String o : s){
            System.out.println("我的国籍是：" + o);
        }
    }

    @Override
    public int compareTo(Object o) {
        return 0;
    }

    public static void info(){
        System.out.println("这是一个静态的方法!");
    }

}
